package com.spring.boot.service.impl;

import com.spring.boot.annotation.DataSourceAnnotation;
import com.spring.boot.bean.Users;
import com.spring.boot.dao.UserDao;
import com.spring.boot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @program: springboot_vue
 * @description: 用户管理实现类
 * @author: ry
 * @create: 2018-08-15 16:23
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;
    /**
     * 新建用户
     * @param datasource
     * @param users
     */
    @DataSourceAnnotation
    @Transactional
    @Override
    public void insertUser(String datasource, Users users) {
        userDao.insertUser(users);
    }
}
